import { defineStore } from "pinia";

export const userStore = defineStore('userInfoStore', {
    persist: true,//持久化储存

    state: () => {
        return {
            userToken: '',
            userName: '',
            userPhone: '',
        }
    },
    actions: {
        setUserToken(payload) {
            this.userToken = payload
        },
        setUserName(payload) {
            this.userName = payload
        },
        setUserPhone(payload) {
            this.userPhone = payload
        },
    },
    getters: {
        getUserToken() {
            return this.userToken
        },
        getUserName() {
            return this.userName
        },
        getUserPhone() {
            return this.userPhone
        }
    }
})
